<template>
  <div class="flod_panel">
      <span @click="toggleTree" class="flod_btn">
        <i class="iconfont icon-arrow_shouqi" v-if="!treeClose"></i>
        <i class="iconfont icon-arrow_zhankai" v-if="treeClose"></i>
      </span>
  </div>
</template>

<script>
export default {
  name: 'TreeFlodBtn',
  data() {
    return {
      treeClose: false
    }
  },
  methods: {
    toggleTree() {
      this.treeClose = !this.treeClose
      this.$emit('toggleTree', this.treeClose)
    }
  }
}
</script>

<style lang="less">
  .flod_panel{
    position: absolute;
    right: -2px;
    height: 100%;
    border-left: @mesBorDefault;
    z-index: 999;
  }
  .flod_btn {
    color: #333;
    cursor: pointer;
    position: absolute;
    width: 16px;
    height: 50px;
    line-height: 50px;
    margin: auto;
    top: 0;
    bottom: 0;
    background-color: #f8f8f9;
    border: @mesBorDefault;
    border-left: none;
    border-radius: 0 4px 4px 0;
  }
</style>
